//package com.fecean.aabbc.netty.server.prod2;
//
//import com.fecean.aabbc.netty.message2.NettyMessageBuilder;
//import io.netty.channel.ChannelHandler;
//import io.netty.channel.ChannelHandlerContext;
//import io.netty.channel.ChannelInboundHandlerAdapter;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//
///**
// ** 服务端心跳通道处理，目前处理是把消息原样发回给客户端
// *
// * @author: chenfenghai
// * @version: 1.0
// * @date: 2020-03-05 15:59
// * @blame Team
// */
//@Slf4j
//@Component
//@ChannelHandler.Sharable
//public class NettyServerHeartbeatHandler extends ChannelInboundHandlerAdapter {
//
//    @Override
//    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
//        NettyMessageBuilder messageBuilder = NettyMessageBuilder.readMessage(msg);
//        if(messageBuilder.isHeartbeatMessage()){
//            log.info("服务端收到心跳[{}-{}]",
//                    messageBuilder.getNettyMessage().getTenantId(),
//                    messageBuilder.getNettyMessage().getCinemaCode());
//            ctx.channel().writeAndFlush(msg);
//        }else{
//            ctx.fireChannelRead(msg);
//        }
//    }
//
//}
